/*
 * @Descripttion: 条码接口
 * @version: V1.0
 * @Author: GW
 * @Date: 2021-11-03 14:26:06
 * @LastEditors: GW
 * @LastEditTime: 2021-12-10 17:55:19
 */

import { axios } from "../../utils/request";


/**
* 获取条码属性列表
*/
export function listAttr (data) {
    return axios({
        url: '/barcode/attribute/getList',
        method: "get",
        params: data,
        timeout: 500000,
    });
}


/**
 * 新增/修改条码属性
 * @param {*} data
 */
export function saveAttr (data) {
    return axios({
        url: '/barcode/attribute/save',
        method: "post",
        data: data
    });
}

/**
 * 删除条码属性
 */
export function deleteAttr (data) {
    return axios({
        url: '/barcode/attribute/delete',
        method: "delete",
        params: data
    });
}


//获取业务对象

export function getVoucherDesign (data) {
    return axios({
        url: '/erp/voucherTable/listByDto',
        method: "get",
        params: data
    });
}
/**
 * 获取业务对象详情
 */
export function getAttrObjectDetails (data) {
    return axios({
        url: '/barcode/attribute/getDetail',
        method: "get",
        params: data
    });
}









//条码规则保存
export function saveRule (data) {
    return axios({
        url: '/erp/barcode/rule/save',
        method: "post",
        data: data
    });
}
//条码规则列表
export function listRule (data) {
    return axios({
        url: '/erp/barcode/rule/page',
        method: "get",
        params: data,
        timeout: 500000,
    });
}
//条码规则详情
export function getRuleDetails (data) {
    return axios({
        url: '/erp/barcode/rule/detailById',
        method: "get",
        params: data
    });
}
//条码规则删除
export function deleteRule (data) {
    return axios({
        url: '/erp/barcode/rule/deleteByIds',
        method: "delete",
        data: data
    });
}




//模板保存
export function saveTemplate (data) {
    return axios({
        url: '/barcode/template/save',
        method: "post",
        data: data
    });
}
//模板列表
export function listTemplate (data) {
    return axios({
        url: '/barcode/template/getList',
        method: "get",
        params: data,
        timeout: 500000,
    });
}
//模板删除
export function deleteTemplate (data) {
    return axios({
        url: '/barcode/template/delete',
        method: "delete",
        params: data
    });
}


//生成 条码
export function generateTheBarcode (data) {
    return axios({
        url: '/erp/barcode/print/save',
        method: "post",
        data: data
    });
}

//获取生成条码详情
export function barcodeDetail (data) {
    return axios({
        url: '/erp/barcode/print/detailById',
        method: "get",
        params: data
    });
}


//下载插件
export function downLoadexe (data) {
    return axios({
        url: '/erp/barcode/mainInfo/getBarCodeFileUrl',
        method: "get",
        params: data
    });
}

//条码解析
export function analysisByBarCode (data) {
    return axios({
        url: '/erp/barcode/mainInfo/analysisByBarCode',
        method: 'get',
        params: data,
    })
}

//条码打印列表
export function pageList (data) {
    return axios({
        url: '/erp/barcode/print/page',
        method: 'get',
        params: data,
    })
}


//通过 来源明细ID 和 来源类型 获取条码主档信息
export function getCodeListDetails (data) {
    return axios({
        url: '/erp/barcode/mainInfo/listByDetailIdsAndSourceVoucherType',
        method: 'post',
        data: data,
    })
}



